const sysinfo = 'server api crashed';

export default {
    userLogin(me, cb) { //登录信息
        $.ajax({
            type: "POST",
            url: me.cfg.api + "/user/userLogin",
            data: {
                username: me.util.string.replaceAll(me.username, " ", ""),
                password: me.util.string.replaceAll(me.password, " ", "")
            }
        }).done(data => {
            if (data.code == 200) {
                sessionStorage.setItem("user", JSON.stringify(data.data));
                me.setUserInfo(JSON.parse(sessionStorage.getItem('user')));
                // console.log(data.data);
                cb && cb(data)
            } else {
                layer.alert(data.message);
            }
        });
    },
    updateSystemConfigByName(me, obj, cb) { //系统设置页面:修改设置
        $.ajax({
            type: "POST",
            url: me.cfg.api + "/config/updateSystemConfigByName",
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb && cb(data);
            }
        });
    },
    updateAllKouL(me, cb) { //系统设置页面:修改整单扣率
        $.ajax({
            type: 'GET',
            url: me.cfg.api + "/ls/updateAllKouL",
            data: {
                id: me.fdId,
                allKouL: me.setConfig.zdkoul
            }
        }).done(data => {
            if (data.code == 200) {
                localStorage.setItem('zdkoul', me.setConfig.zdkoul);
                cb && cb(data.data);
                layer.alert(data.message);
            }
        })
    },
    updateHuiyuanKoulv(me, obj, cb) { //系统设置页面：修改会员初始扣率 
        $.ajax({
            type: 'POST',
            url: me.cfg.api + '/huiyuan/updateHuiyuanKoulv',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            } else {
                layer.alert(data.message);
            }
        })
    },
    selectHuiyuanKoulv(me, cb) { //系统设置页面：会员初始扣率查询
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/huiyuan/selectHuiyuanKoulv',
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            } else {
                layer.alert(data.message);
            }
        })
    },
    selectSystemConfigList(me, cb) { //系统设置页面:获取配置信息（库存，扣率，自动结算）
        $.ajax({
            type: "GET",
            url: me.cfg.api + "/config/selectSystemConfigList",
            dataType: "json",
            data: {
                sktid: localStorage.getItem("sktId"),
                fdbs: me.fdbs
            }
        }).done(data => {
            if (data.code == 200) {
                data.data.forEach((item, index) => {
                    if (item.name == "NEGATIVE_INVENTORY") {
                        me.$set(me.setConfig, 'kucun', item.value);
                    }
                    if (item.name == "RETURNED_GOODS") {
                        me.$set(me.setConfig, 'tuihuo', item.value);
                    }
                    if (item.name == "AUTOCOMMIT") {
                        me.$set(me.setConfig, 'tijiao', item.value);
                    }
                    if (item.name == "LOWEST_KOULV") {
                        me.$set(me.setConfig, 'koulv', item.value);
                    }
                });
                cb && cb(data.data);
            }
        });
    },
    insertHYKoulv(me, obj, cb) { //系统设置页面:保存会员扣率
        $.ajax({
            type: "POST",
            url: me.cfg.api + "/huiyuan/insertHYKoulv",
            data: obj,
            dataType: "json",
        }).done(data => {
            cb && cb(data)
        })
    },
    updateHYKoulvByFdbs(me, obj) {
        $.ajax({
            type: "POST",
            url: me.cfg.api + "/huiyuan/updateHYKoulvByFdbs",
            data: obj,
            dataType: "json",
        }).done(data => {})
    },
    duizhang(me, cb) { //日清页面：获取对账数据
        $.ajax({
            type: 'GET',
            url: me.cfg.api + "/rq/duizhang",
            data: {
                fdbs: me.fdbs
            }
        }).done(data => {
            if (data.code == 200) {
                me.mysqlJine = parseFloat(data.data.mysqlJine).toFixed(2);
                me.sqlServerJine = parseFloat(data.data.sqlServerJine).toFixed(2);
            } else {
                me.mysqlJine = '';
                me.sqlServerJine = ''
            }
        })
    },
    checkoutRiQing(me, cb) { //日清页面：对账
        $.ajax({
            type: "POST",
            url: me.cfg.api + "/rq/checkoutRiQing",
            data: {
                fdbs: me.fdbs
            }
        }).done(data => {
            if (data.code == "1") {
                me.sqlServerJine = me.mysqlJine;
                me.account = true;
                me.nissin = false;
                me.accountloading = false;
            } else {
                layer.alert(data.msg);
                me.accountloading = false;
            }
        });
    },
    executeRiQing(me, obj) { //日清页面：日清
        $.ajax({
            type: "POST",
            url: me.cfg.api + "/rq/executeRiQing",
            data: obj
        }).done(data => {
            if (data.code == 1) {
                me.uniqueIdentify = data.data;
                me.loading = false;
                me.nissin = true;
                me.settlement = false;
            } else {
                layer.alert(data.msg);
            }
        });
    },
    selectRiQingJieSuan(me) { //日清页面：辅助结算
        $.ajax({
            type: "GET",
            url: me.cfg.api + "/rq/selectRiQingJieSuan",
            data: {
                uniqueIdentify: me.uniqueIdentify
            }
        }).done(data => {
            if (data.code == 200) {
                // me.receivables = data.data;
                data.data.forEach((item, index) => {
                    if ($.trim(item.jsfsmch) == '现金') {
                        me.receivables.cash = item.je;
                    }
                    if ($.trim(item.jsfsmch) == '银联') {
                        me.receivables.unionpay = item.je;
                    }
                    if ($.trim(item.jsfsmch) == '微信') {
                        me.receivables.weixin = item.je;
                    }
                    if ($.trim(item.jsfsmch) == '支付宝') {
                        me.receivables.alipay = item.je;
                    }
                })
                me.settlement = false;
                $('#md_nissin').modal('hide');
                me.re = true;
            } else {
                layer.alert(data.msg);
            }
        });
    },
    insertXianJinMX(me) { //日清页面：面额
        $.ajax({
            type: "POST",
            url: me.cfg.api + "/rq/insertXianJinMX",
            data: datas
        }).done(data => {
            console.log(data);
        });
    },
    indexLsNew(me, obj, cb) { //零售页面：获取页面加载信息
        $.ajax({
            type: 'GET',
            url: me.cfg.api + "/ls/indexLsNew",
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    deleteTheDeal(me, cb) { //零售页面：删除现在有数据
        $.ajax({
            type: "POST",
            url: me.cfg.api + "/ls/deleteTheDeal",
            dataType: "json",
            data: {
                lshh: me.initialization.liushui,
                sktid: me.initialization.cashier.sktid,
                fdbs: me.initialization.fdbsMap.fdbs
            }
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectMaLs(me, obj, cb) { //零售页面：获取更多流水
        $.ajax({
            type: "GET",
            url: me.cfg.api + "/TmpPosMastController/selectMaLs",
            data: obj,
            dataType: 'json'
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        });
    },
    selectGeneralShowZiDuan(me) { //零售页面：获取页面主体表格th
        $.ajax({
            type: "GET",
            url: me.cfg.api + "/ls/selectGeneralShowZiDuan",
            data: {
                pageName: "MXLS_SHOW"
            },
            dataType: "json"
        }).done(function(data) {
            if (data.code == 200) {
                me.initialization.mainHead = data.data;
                console.log(data, 45789);
            }
        });
    },
    selectLsh(me, cb) { //零售页面：获取流水号
        $.ajax({
            type: "GET",
            url: me.cfg.api + "/ls/selectLsh",
            data: {
                sktid: me.initialization.cashier.sktid
            },
            dataType: "json"
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectTmpPosMast(me) { //零售页面：获取收款方式
        $.ajax({
            type: "GET",
            url: me.cfg.api + "/TmpPosJelsController/selectTmpPosMast",
            data: {
                page: 1,
                rows: 5
            },
            dataType: "json"
        }).done(data => {
            if (data.code == 200) {
                console.log(data, '64545445465');
                me.paymentMethodsA = data.data.list;
                console.log(me.paymentMethodsA, 'aaaaaaaaaaaaaaaa');
                me.paymentMethods = me.paymentMethodsA[0];
                console.log(me.paymentMethods, 'bbbbbbbbbbbbbbbb');
            } else {
                alert(123)
            }
        });
    },
    pay(me, obj, cb) { //零售页面：交易
        $.ajax({
            type: "POST",
            url: me.cfg.api + "/PayController/pay",
            data: obj,
            dataType: "json"
        }).done(data => {
            cb & cb(data);
        }).fail(data => {
            layer.open({
                content: '数据错误，请联系管理员或按F6取消当前订单',
                yes: function(index, layero) {
                    layer.close(index);
                    history.go(0);
                }
            });
        })
    },
    insert(me, obj, cb) {
        $.ajax({
            type: "POST",
            url: me.cfg.api + "/TmpPosMastController/insert",
            data: obj,
            dataType: "json"
        }).done(data => {
            cb & cb(data);
        })
    },
    selectFdbs(me, cb) { //分店标识
        $.ajax({
            type: "GET",
            url: me.cfg.api + "/ls/selectFdbs",
            dataType: "json"
        }).done(res => {
            if (res.code == 200) {
                cb & cb(res);
            }
        })
    },
    deleteBySktid(me, cb) { //零售页面：取消收款
        $.ajax({
            type: "GET",
            url: me.cfg.api + "/TmpPosMastController/deleteBySktid",
            data: {
                sktid: me.initialization.cashier.sktid, //收银台内码
                lshh: me.initialization.liushui //流水号
            },
            dataType: "json"
        }).done(data => {
            if (data.code == 200) {
                dingPay = true;
            }
        });
    },
    selectHuiYuanFuzzy(me, fun) { //零售页面:搜索会员
        $.ajax({
            type: "GET",
            url: me.cfg.api + "/huiyuan/selectHuiYuanFuzzy",
            dataType: "json",
            data: {
                fuzzyname: me.changeValue.searchMsg,
                fdbs: me.initialization.fdbsMap.fdbs
            }
        }).done(data => {
            if (data.code == 200) {
                let res = data.data;
                if (res.length > 0) {
                    me.Adorn2 = true;
                }
                let reslist = [];
                for (let i = 0; i < res.length; i++) {
                    let vo = res[i];
                    reslist.push({
                        label: vo.zjm + "," + vo.callnum + "," + vo.kkhname + "," + vo.cardid,
                        kkhname: vo.kkhname,
                        callnum: vo.callnum,
                        jifen: vo.jifen,
                        cardid: vo.cardid,
                        ydjifen: vo.ydjifen,
                        ljxfe: vo.ljxfe,
                        zdkoul: vo.koulv
                    });
                }
                fun(reslist);
            }
        })
    },
    selectHuiYuanDetail(me, ui, cb) { //零售页面：搜索会员确认
        $.ajax({
            type: "GET",
            url: me.cfg.api + "/huiyuan/selectHuiYuanDetail",
            dataType: "json",
            data: ui.item
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectSPInfoFuzzy(me, fun) { //零售页面：药品搜索
        $.ajax({
            type: "GET",
            url: me.cfg.api + "/ls/selectSPInfoFuzzy",
            dataType: "json",
            data: {
                fuzzyname: me.changeValue.searchMsg
            }
        }).done(data => {
            if (data.code = 200) {
                let res = data.data;
                if (res.length > 0) {
                    me.Adorn1 = true;
                }
                console.log(me.plh, '4545454545454');
                let reslist = [];
                for (let i = 0; i < res.length; i++) {
                    let vo = res[i];
                    reslist.push({
                        id: vo.id,
                        label: vo.spmch + "　│规：" + vo.shpgg + "　│产：" + vo.shpchd + "　│码：" + vo.spbh + "　│价：" + vo.lshj + "元 " + "　│批：" + vo.pihao,
                        value: $.trim(vo.spmch),
                        lshh: me.initialization.liushui, //流水号
                        plh: vo.plh, //排列号
                        spid: vo.spid, //数据
                        hw: $("#k_alt_z option:selected").val(), //货位编码
                        sktid: me.initialization.cashier.sktid, //收银编码
                        shky: me.initialization.cashier.shky, //收银员name
                        shkyid: me.initialization.cashier.shkyid, //收银员内码
                        bm: $("#k_alt_m option:selected").text(), //部门
                        huowname: me.initialization.huowname, //货位名称
                        xshyid: $("#k_alt_y option:selected").val(), //销售员编码
                        xshy: $("#k_alt_y option:selected").text(), //销售员名称
                        pihao: vo.pihao, //批号
                        sptm: vo.sptm,
                        cardid: me.member.huiyuanid, //会员卡
                        fdbs: me.initialization.fdbsMap.fdbs, //分店标识
                        isNegativeInventory: 1, //是否允许负库存
                        overallKouLv: me.zdkoul, //整单扣率
                        lowestKouLv: me.initialization.setConfig.koulv.value, //最低扣率
                        shpchd: vo.shpchd,
                        jxqts: vo.jxqts
                    });
                }
                fun(reslist);
            }
        })
    },
    insertTmpPosMxls(me, ui) { //零售页面:搜索药品确认
        $.ajax({
            type: "POST",
            url: me.cfg.api + "/ls/insertTmpPosMxls",
            dataType: "json",
            data: ui.item
        }).done(function(data) {
            if (data.code == 1) {
                console.log(data, 'rrrrrrrrrrrrrrrrrrrrrrrr');
                me.mainBody.push(data.data);
                me.changeValue.searchMsg = "";
                me.initialization.trIdx = me.mainBody.length - 1;
                me.onSettlement();
                me.onScroll();
                if (me.initialization.setConfig.tijiao.value == 0) {
                    setTimeout(function() {
                        let o = $("#j_drugList").find(".on");
                        o.trigger("click");
                        setTimeout(function() {
                            $("#k_alt_s").focus().select();
                        }, 0);
                    }, 0);
                } else {
                    setTimeout(function() {
                        let o = $("#j_drugList").find(".on");
                        o.trigger("click");
                        setTimeout(function() {
                            $('#j_searchDrug').focus();
                        }, 0);
                    }, 0);
                }
                setItemMethod("mainBody", me.mainBody);
            } else if (data.code == 401) {
                alert("服务器错误");
            } else {
                alert(data.msg);
            }
        });
    },
    updateTmpPosMxlsKouLv(me, obj, cb) { //零售页面：修改扣率
        $.ajax({
            type: "POST",
            url: me.cfg.api + "/ls/updateTmpPosMxlsKouLv",
            dataType: "json",
            data: obj
        }).done(data => {
            if (data.code == 1) {
                cb & cb(data);
            } else {
                me.koulMsg = data.msg;
                $('#k_alt_c').focus();
            }

        });
    },
    updateTmpPosMxlsDanJia(me, obj, cb) { //零售页面：修改单价
        $.ajax({
            type: "POST",
            url: me.cfg.api + "/ls/updateTmpPosMxlsDanJia",
            dataType: "json",
            data: obj
        }).done(data => {
            if (data.code == 1) {
                cb & cb(data);
            }
        });
    },
    updateTmpPosMxlsShuLiang(me, obj, cb) { //零售页面：修改数量
        $.ajax({
            type: "POST",
            url: me.cfg.api + "/ls/updateTmpPosMxlsShuLiang",
            dataType: "json",
            data: obj
        }).done(data => {
            cb & cb(data);
        })
    },
    saveKuCunShulSync(me) { //零售页面：同步库存
        $.ajax({
            type: 'POST',
            url: me.cfg.api + "/kucun/saveKuCunShulSync",
        }).done(data => {
            layer.alert(data.message);
        })
    },
    deleteTmpPosMxls(me, obj, cb) { //零售页面：delete键删除数据
        $.ajax({
            type: "POST",
            url: me.cfg.api + "/ls/deleteTmpPosMxls",
            dataType: "json",
            data: obj
        }).done(data => {
            cb & cb(data);
        })
    },
    selectDYXPDY(me, obj, cb) { //打印任意一张小票:查询
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/PosMxlsController/selectDYXPDY',
            data: obj,
            dataType: 'json',
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectDYXP(me, obj, cb) {
        $.ajax({
            type: 'get',
            url: me.cfg.api + '/PosMxlsController/selectDYXP',
            data: obj,
            dataType: 'json',
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectSKYSKHZ(me, cb) { //收款台监测：在岗收款员收款总汇
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/frontMonitor/selectSKYSKHZ',
            data: { fdbs: localStorage.getItem('fdbs') }
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectSPXSHZ(me, cb) { //收款台监测：商品销售汇总
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/frontMonitor/selectSPXSHZ',
            data: { fdbs: localStorage.getItem('fdbs') }
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectGSKTYXJEZK(me, cb) { //收款台监测：各款台银箱金额状况
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/frontMonitor/selectGSKTYXJEZK',
            data: { fdbs: localStorage.getItem('fdbs') }
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectSKJEJG(me, cb) { //收款台监测：各款台银箱金额状况
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/frontMonitor/selectSKJEJG',
            data: { fdbs: localStorage.getItem('fdbs') }
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectQTKCJCAll(me, obj, cb) { //收款台监测：所用品种
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/frontMonitor/selectQTKCJCAll',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectQTKCJCNeedPeiHuo(me, obj, cb) { //收款台监测：需要配货的品种
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/frontMonitor/selectQTKCJCNeedPeiHuo',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectKQYaoShiList(me, cb) { //门店考勤记录：查询药师
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/yaoJianReport/selectKQYaoShiList',
            data: { fdbs: localStorage.getItem('fdbs') }
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectYaoShiKQRecordList(me, obj, cb) { //门店考勤记录：考勤药师列表
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/yaoJianReport/selectYaoShiKQRecordList',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    deleteYaoShiKQRecord(me, obj, cb) { //门店考勤记录：删除考勤药师
        $.ajax({
            type: 'POST',
            url: me.cfg.api + '/yaoJianReport/deleteYaoShiKQRecord',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    updateYaoShiKQRecord(me, obj, cb) { //门店考勤记录：修改考勤药师
        $.ajax({
            type: 'POST',
            url: me.cfg.api + '/yaoJianReport/updateYaoShiKQRecord',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    addYaoShiKQRecord(me, obj, cb) { //门店考勤记录：添加考勤
        $.ajax({
            type: 'POST',
            url: me.cfg.api + '/yaoJianReport/addYaoShiKQRecord',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            } else {
                layer.alert(data.message);
            }
        })
    },
    selectKQShopList(me, cb) { //门店考勤记录：门店信息
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/yaoJianReport/selectKQShopList',
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectHumitureRecordList(me, obj, cb) { //门店温湿度记录：表格查询
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/yaoJianReport/selectHumitureRecordList',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    addHumitureRecord(me, obj, cb) { //门店温湿度记录：添加温湿度记录
        $.ajax({
            type: 'POST',
            url: me.cfg.api + '/yaoJianReport/addHumitureRecord',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            } else {
                layer.alert(data.message);
            }
        })
    },
    deleteHumitureRecord(me, obj, cb) { //门店温湿度记录：删除温湿度记录
        $.ajax({
            type: 'POST',
            url: me.cfg.api + '/yaoJianReport/deleteHumitureRecord',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            } else {
                layer.alert(data.message);
            }
        })
    },
    updateHumitureRecord(me, obj, cb) { //门店温湿度记录：修改温湿度记录
        $.ajax({
            type: 'POST',
            url: me.cfg.api + '/yaoJianReport/updateHumitureRecord',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            } else {
                layer.alert(data.message);
            }
        })
    },
    selectXSSKLSMX(me, obj, cb) { //销售收款流水:表格查询
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/frontMonitor/selectXSSKLSMX',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            } else {
                layer.alert(data.message);
            }
        })
    },
    selectBuysRecord(me, obj, cb) { //药监数据导出：购进记录
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/yaoJianReport/selectBuysRecord',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectSalesRecord(me, obj, cb) { //药监数据导出：销售记录
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/yaoJianReport/selectSalesRecord',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectStocksRecord(me, obj, cb) { //药监数据导出：库存记录
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/yaoJianReport/selectStocksRecord',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectRecallRecord(me, obj, cb) { //药监数据导出：召回记录
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/yaoJianReport/selectRecallRecord',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    exportAllYaoJianRecord(me, obj, cb) { //药监数据导出：一键导出
        $.ajax({
            type: 'POST',
            url: me.cfg.api + "/yaoJianReport/exportAllYaoJianRecord",
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            } else {
                layer.alert(data.message);
            }
        })
    },
    selectWRSPXSHZ(me, obj, cb) { //往日商品销售汇总：表格
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/WRLSController/selectWRSPXSHZ',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectWRSPMRXSHZ(me, obj, cb) { //往日商品销售汇总：表格
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/WRLSController/selectWRSPMRXSHZ',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectWRXSYXSQKHZ(me, obj, cb) { //往日收款员汇总 ：收款员日收款汇总
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/WRLSController/selectWRXSYXSQKHZ',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectWRXSYMRXSQKHZ(me, obj, cb) { //往日收款员汇总 ：收款员收款汇总
        $.ajax({
            type: 'GET',
            url: me.cfg.api + '/WRLSController/selectWRXSYMRXSQKHZ',
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    sumSshje(me, cb) { //实时营业额页面：左右饼图
        $.ajax({
            type: 'GET',
            url: me.cfg.api + "/PosMastController/sumSshje",
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectLkS(me, cb) { //实时营业额页面：来客数图表
        $.ajax({
            type: 'GET',
            url: me.cfg.api + "/PosMastController/selectLkS",
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    sumSKYSKQK(me, obj, cb) {
        $.ajax({
            type: 'GET',
            url: me.cfg.api + "/PosMastController/sumSKYSKQK",
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectHYXFQK(me, obj, cb) { //会员销售分析：会员销售分析
        $.ajax({
            type: 'GET',
            url: me.cfg.api + "/huiyuan/selectHYXFQK",
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectHuiYuiJiFenDuiHuanList(me, obj, cb) { //会员销售分析：兑换积分
        $.ajax({
            type: 'GET',
            url: me.cfg.api + "/huiyuan/selectHuiYuiJiFenDuiHuanList",
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectOneHuiyuan(me, obj, cb) {
        $.ajax({
            type: 'GET',
            url: me.cfg.api + "/huiyuan/selectOneHuiyuan",
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectSKFSHZ(me, obj, cb) { //往日收款方式汇总：往日收款方式汇总
        $.ajax({
            type: 'GET',
            url: me.cfg.api + "/WRLSController/selectSKFSHZ",
            data: obj
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    },
    selectSktidList(me, cb) { //当日交易流水：收款台列表
        $.ajax({
            type: 'GET',
            url: me.cfg.api + "/ls/selectSktidList",
        }).done(data => {
            if (data.code == 200) {
                cb & cb(data);
            }
        })
    }
}

//success=done
//error=fail
//complete=always